import java.util.Scanner;
public class task2 {
        static  int max(int a[]){
        int maxnum=0;
        for(int i=0;i<a.length;i++){
            if(a[i]>0)
                maxnum+=a[i];
        }
        return maxnum;

    }
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入数组长度：");
        int number = sc.nextInt();
        int[] a = new int[number];
        System.out.println("请输入数组值：");
        for(int i=0;i<number;i++)
             a[i] = sc.nextInt();
        int Max=max(a);
        System.out.printf("最大值为%d", Max);

    }

}



